
import java.io.IOException;
import java.util.Random;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author leehoa
 */
public class randomString {
    public static void main(String[] args) throws IOException, InterruptedException {
        
        String st = "QWERTYUIOPASDFGHJKLZXCVBNMabcdefghijklmnopqrstuvwxyz1234567890";
        String result = "";
        for (int i = 0; i < 10; i++) {
            int temp = (int) Math.round(Math.random() * st.length());
            result += st.charAt(temp);
        }
        System.out.println(""+result);
        for(int j=0;j<5000;j++){
//            System.out.println(j+"\t"+getSession());
            System.out.println(j+"\t"+getst());
//            Thread.sleep(100);
        }
//        System.out.println(""+getst());
        
    }
    
    public static String getst(){
        String temps = "QWERTYUIOPASDFGHJKLZXCVBNMabcdefghijklmnopqrstuvwxyz1234567890";
        Random rnd = new Random();
        StringBuilder sb = new StringBuilder( 10 );
       for( int i = 0; i < 10; i++ ) 
          sb.append( temps.charAt( rnd.nextInt(temps.length()) ) );
       return sb.toString();        
    }
    
    public static  String getSession(){
//        String temps = "QWERTYUIOPASDFGHJKLZXCVBNMabcdefghijklmnopqrstuvwxyz1234567890";
//        String temps = "abcdefghijklmnopqrstuvwxyz1234567890";
//        String temps = "abcdefghijklmnopqrstuvwxyz";
        String temps = "1a2b34567890";
        String session = "";
        int temp = 0;
        for (int i = 0; i < 10; i++) {
            temp = (int) Math.round((Math.random() *1000)% temps.length());
            session += temps.charAt(temp);
        }
        return session;          
    }
    
}
